﻿package Message.BroadCast
{
    import Framework.MQ.*;
    import Framework.Serialize.*;
    import Message.Public.*;
    import flash.utils.*;

    public class SEntityInfo extends IMessageBase
    {
        public var entityId:SEntityId;
        public var ownerEntityId:SEntityId;
        public var toEntityId:SEntityId;
        public var name:String;
        public var code:int;
        public var life:int;
        public var maxLife:int;
        public var mana:int;
        public var maxMana:int;
        public var camp:int;
        public var force:int;
        public var sex:int;
        public var career:int;
        public var VIP:int;
        public var level:int;
        public var status:int;
        public var fighting:Boolean;
        public var fightMode:int;
        public var speed:int;
        public var direction:int;
        public var model:int;
        public var mountCode:int;
        public var combat:int;
        public var guildName:String;
        public var guildPosition:int;
        public var entityShows:Dictionary;
        public var reserveJs:String;
        public var points:Array;
        public var buffInfos:Array;
        public var groupId:SEntityId;
        public var guildId:SEntityId;
        public var titleId:int;
        public var spriteCode:int;
        public var isInit:Boolean;
        public const _type:int = 11003;
        public static var _regist:SEntityInfo = new SEntityInfo(true);

        public function SEntityInfo(param1:Boolean = false)
        {
            if (param1)
            {
                MessageManager.instance().regist(this);
            }
            return;
        }// end function

        override public function getType() : int
        {
            return this._type;
        }// end function

        override public function clone() : IMessageBase
        {
            return new SEntityInfo();
        }// end function

        override public function __write(param1:SerializeStream) : void
        {
            this.entityId.__write(param1);
            this.ownerEntityId.__write(param1);
            this.toEntityId.__write(param1);
            param1.writeString(this.name);
            param1.writeInt(this.code);
            param1.writeInt(this.life);
            param1.writeInt(this.maxLife);
            param1.writeInt(this.mana);
            param1.writeInt(this.maxMana);
            param1.writeByte(this.camp);
            param1.writeByte(this.force);
            param1.writeByte(this.sex);
            param1.writeShort(this.career);
            param1.writeShort(this.VIP);
            param1.writeByte(this.level);
            param1.writeByte(this.status);
            param1.writeBool(this.fighting);
            param1.writeByte(this.fightMode);
            param1.writeShort(this.speed);
            param1.writeShort(this.direction);
            param1.writeInt(this.model);
            param1.writeInt(this.mountCode);
            param1.writeInt(this.combat);
            param1.writeString(this.guildName);
            param1.writeByte(this.guildPosition);
            DictIntIntHelper.write(param1, this.entityShows);
            param1.writeString(this.reserveJs);
            SeqPointHelper.write(param1, this.points);
            SeqBuffInfoHelper.write(param1, this.buffInfos);
            this.groupId.__write(param1);
            this.guildId.__write(param1);
            param1.writeInt(this.titleId);
            param1.writeInt(this.spriteCode);
            param1.writeBool(this.isInit);
            return;
        }// end function

        override public function __read(param1:SerializeStream) : void
        {
            this.entityId = new SEntityId();
            this.entityId.__read(param1);
            this.ownerEntityId = new SEntityId();
            this.ownerEntityId.__read(param1);
            this.toEntityId = new SEntityId();
            this.toEntityId.__read(param1);
            this.name = param1.readString();
            this.code = param1.readInt();
            this.life = param1.readInt();
            this.maxLife = param1.readInt();
            this.mana = param1.readInt();
            this.maxMana = param1.readInt();
            this.camp = param1.readByte();
            this.force = param1.readByte();
            this.sex = param1.readByte();
            this.career = param1.readShort();
            this.VIP = param1.readShort();
            this.level = param1.readByte();
            this.status = param1.readByte();
            this.fighting = param1.readBool();
            this.fightMode = param1.readByte();
            this.speed = param1.readShort();
            this.direction = param1.readShort();
            this.model = param1.readInt();
            this.mountCode = param1.readInt();
            this.combat = param1.readInt();
            this.guildName = param1.readString();
            this.guildPosition = param1.readByte();
            this.entityShows = DictIntIntHelper.read(param1);
            this.reserveJs = param1.readString();
            this.points = SeqPointHelper.read(param1);
            this.buffInfos = SeqBuffInfoHelper.read(param1);
            this.groupId = new SEntityId();
            this.groupId.__read(param1);
            this.guildId = new SEntityId();
            this.guildId.__read(param1);
            this.titleId = param1.readInt();
            this.spriteCode = param1.readInt();
            this.isInit = param1.readBool();
            return;
        }// end function

    }
}
